package arithmetic;

import java.util.Scanner;

/**
 * @program: javaLearn
 * @description: 202112-1
 * @author: renhai
 * @Date ：2022/2/28 19:48
 **/
public class Q202112_1 {
    public static void main(String[] args) {
        int N = 210;
        int[] a = new int[N];
        int[] s = new int[N];
        Scanner scanner = new Scanner(System.in);
        int n ;
        int m ;
        n = scanner.nextInt();
        m = scanner.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i]=scanner.nextInt();
        }
        int sum=0;
        for (int i=1;i<n;i++)
        {
            s[i]=a[i+1]-a[i];
        }
        for (int i=1;i<n;i++)
        {
            sum+=s[i]*i;
        }
        sum+=n*(m-a[n]);
        System.out.println(sum);
    }
}
